package tms.sync.main;
import java.util.List;
import java.util.Map;

import tms.sync.service.TmsSyncEXclassService;
import tms.sync.service.TmsSyncRealService;


public class TmsSyncRealMain {

	/**
	 * @param args
	 * @throws Exception 
	 */
	public static void main(String[] args) throws Exception {
		System.out.println("[ LOG ] : TmsSyncReal Main Start");

//		TmsSyncRealService tmsSyncRealService = TmsSyncRealService.getInstance();
//		List<?> listResult = tmsSyncRealService.getUserInfo("tomato");
		
//		TmsSyncEXclassService tmsSyncEXclassService = TmsSyncEXclassService.getInstance();
//		List<?> listResultEXclass = tmsSyncEXclassService.getUserInfo("tomato");
//		int count = tmsSyncEXclassService.getDictionaryInsert();
		
		// 용어사전 맥스 키 값 조회
		TmsSyncEXclassService tmsSyncEXclassService = TmsSyncEXclassService.getInstance();
		Map voMapDeptSearchParam = tmsSyncEXclassService.getDeptDictionaryInfo();
		
		System.out.println("[ LOG ] : INSERT START");
		// 부서 코드 조회 용어코드 PK 생성 포함
		TmsSyncRealService tmsSyncRealService = TmsSyncRealService.getInstance();
		List<?> voListResultReal = tmsSyncRealService.getDeptInfo(voMapDeptSearchParam);
		
		int voListCnt = voListResultReal.size();
		for(int i=0; i<voListCnt; i++){
			Map voListMap = (Map) voListResultReal.get(i);
			tmsSyncEXclassService.getDictionaryInsert(voListMap);
			tmsSyncEXclassService.getDeptInsert(voListMap);
		}
//		for(int i=0; i<voListCnt; i++){
//			Map voListMap = (Map) voListResultReal.get(i);
//			tmsSyncEXclassService.getDeptInsert(voListMap);
//		}
		
		
		System.out.println("-----------------------------------------------------------------------------------");
		
//		int voListCnt = listResult.size();
//		int count = 0;
//		for(int i=0; i<voListCnt; i++){
//			Map getListMap = (Map) listResult.get(i);
//			TmsSyncEXclassService tmsSyncEXclassService = TmsSyncEXclassService.getInstance();
//			count = tmsSyncEXclassService.getDictionaryInsert(getListMap);
//		}
//		
//		System.out.println("[ LOG ] : END COUNT = " + count);
		
//		TmsSyncEXclassService tmsSyncEXclassService = TmsSyncEXclassService.getInstance();
//		List<?> listResultEXclass = tmsSyncEXclassService.getUserInfo("tomato");
//		int count = tmsSyncEXclassService.getDictionaryInsert();
	}

}
